RAIS  3.2
C:/Projekte/RAIS/common/RADEVClasses/RadiationDevice.cs
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 using System;
00006 using System.Collections.Generic;
00007 using System.Data;
00008 namespace RAIS.Common.RADEVClasses
00009 {
00010     public class RadiationDevice : RADEVTable
00011     {
00012         #region Fields
00013         //protected const string commandString = "SELECT * FROM RadiationDevice";
00014                 protected const string commandString = "SELECT * FROM [RADEV Report - Radiation Devices]()";
00015                 protected const string sourceName = "RADEVData_RadiationDevice";
00016         private static List<RADEVTable> data = new List<RADEVTable>();
00017 
00018         string _deviceName = "";
00019         string _devManufacturer = "";
00020         string _devModel = "";
00021         string _devSerial = "";
00022         #endregion
00023         #region Properties
00024 
00025 
00026 
00027         public string DeviceName { get { return _deviceName; } }
00031         public string DevManufacturer { get { return _devManufacturer; } }
00035         public string DevModel { get { return _devModel; } }
00039         public string DevSerial { get { return _devSerial; } }
00040         #endregion
00041         #region Public methods
00042 
00043 
00044 
00045 
00046 
00047         public override bool IsValid(RADEVCriterias criterias)
00048         {
00049             return criterias.IAEAEventID == IAEAEventID;
00050         }
00055         public static RADEVTable CreateInstatce()
00056         {
00057             data.Clear();
00058             return new RadiationDevice();
00059         }
00064         public override List<RADEVTable> GetData()
00065         {
00066             return data;
00067         }
00072         public override string GetSourceName()
00073         {
00074             return sourceName;
00075         }
00076         #endregion        
00077         #region Constructors
00078         private RadiationDevice() { }
00079 
00080         public RadiationDevice(IDataReader reader)
00081             : base((string)reader["IAEAEventID"])
00082         {
00083             _deviceName = reader["DeviceName"] is DBNull ? "" : reader["DeviceName"].ToString();
00084             _devManufacturer = reader["DevManufacturer"] is DBNull ? "" : reader["DevManufacturer"].ToString();
00085             _devModel = reader["DevModel"] is DBNull ? "" : reader["DevModel"].ToString();
00086             _devSerial = reader["DevSerial"] is DBNull ? "" : reader["DevSerial"].ToString();
00087         }
00088         #endregion
00089         #region Protected methods
00090         protected override void AddNewRow(IDataReader reader)
00091         {
00092             data.Add(new RadiationDevice(reader));
00093         }
00094         protected override string GetCommandString()
00095         {
00096             return commandString;
00097         }
00098         #endregion
00099     }
00100 }